package com.hwadee.property.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hwadee.property.pojo.Building;
import com.hwadee.property.dto.PageResult;

import java.util.List;

public interface IBuildingService extends IService<Building> {
    PageResult<Building> getPage(int current, int size, Long communityId, Long buildingNumber,
                                 Integer buildingUnit, Integer floorCount, Integer households,
                                 String location, String houseType);

    /**
     * 根据小区 ID 查询楼栋列表
     * @param communityId 小区 ID
     * @return 楼栋列表
     */
    List<Building> listByCommunityId(Long communityId);

    /**
     * 根据楼栋编号查询楼栋信息
     * @param communityId 小区 ID
     * @param buildingNumber 楼栋编号
     * @return 楼栋信息
     */
    Building getByBuildingNumber(Long communityId, Long buildingNumber);

    /**
     * 添加楼栋信息
     * @param building 楼栋信息
     * @return 是否成功
     */
    boolean addBuilding(Building building);

    /**
     * 更新楼栋信息
     * @param building 楼栋信息
     * @return 是否成功
     */
    boolean updateBuilding(Building building);

    /**
     * 删除楼栋信息
     * @param id 楼栋 ID
     * @return 是否成功
     */
    boolean deleteBuilding(Long id);
}
